package cn.memorynine.consumer.controller;

import cn.memorynine.consumer.model.activity.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import cn.memorynine.common.model.ResponseWrapper;
import cn.memorynine.consumer.service.ActivityService;
import cn.memorynine.common.model.ResponseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;

/**
* 用户前台-活动控制器
* @author 代码生成器
*/
@Slf4j
@RestController
@RequestMapping("/consumer/activity")
public class ActivityController {
    @Autowired
    private ActivityService activityService;

    /**
     * 1.获取活动列表
     * @return
     */
    @RequestMapping("/activityList")
    public ResponseWrapper activityList(@RequestBody @Validated ActivityListParam param){
        return activityService.activityList(param);
    }

    /**
     * 2.查看活动详情
     * @return
     */
    @RequestMapping("/activityInfo")
    public ResponseWrapper activityInfo(@RequestBody @Validated ActivityInfoParam param){
        return activityService.activityInfo(param);
    }

    /**
     * 3.参加/退出活动
     * @return
     */
    @RequestMapping("/attendActivity")
    public ResponseWrapper attendActivity(@RequestBody @Validated AttendActivityParam param){
        return activityService.attendActivity(param);
    }

    /**
     * 4.活动状态列表
     * @return
     */
    @RequestMapping("/activityStateList")
    public ResponseWrapper activityStateList(@RequestBody @Validated ActivityStateListParam param){
        return activityService.activityStateList(param);
    }

}